package com.qf.day06.homework;

import java.util.Random;

/**
 * 战士， 独有的属性，怒气值。独有的方法，英勇打击，（攻击力=力量的上下百分之20*2，消耗20怒气）。
 */

public class Warrior extends Hero{
    private int rage;//怒气值
    public void heroicStrike(){ //英勇打击
        Random random = new Random();
        setAttack(unarmedAttack()*2);
        rage=this.rage-20;
    }

    public Warrior() {
    }

    public Warrior(String name, int strength, int agility, int intellect, int rage) {
        super(name, strength, agility, intellect);
        this.rage = rage;
        heroicStrike();
    }

    public int getRage() {
        return rage;
    }

    public void setRage(int rage) {
        this.rage = rage;
    }

    @Override
    public String toString() {
        return "Warrior{" +"名字='" + getName() + '\'' +
                ", 力量=" + getStrength() +
                ", 敏捷=" + getAgility() +
                ", 智力=" + getIntellect() +
                ", 攻击力=" + getAttack() +
                ",怒气值=" + rage +
                "} " ;
    }
}
